package com.xyd.Dao;

import com.xyd.Entity.FatherOrder;
import com.xyd.Entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: DanhaoDao
 * @Description:
 * @Author 余全盛
 * @Date: 2021/10/15 15:08
 */
public interface FatherOrderDao {
    int addOrder(@Param("fatherorderid") long fatherorderid, @Param("sum") double sum, @Param("user") User user);

    FatherOrder selectFatherOrderByID(long fatherOrderid);

    List<FatherOrder> selectAllFatherorderByUser(@Param("user") User user);

    int updateFatherOrderState(@Param("state") int state, @Param("fatherorderid") long fatherorderid);

    //根据用户名关键字和分页获取所有父订单
    List<FatherOrder> getFatherOrderByPagesAndNameKeyWord(Map<String, Object> map);

    //根据用户名关键字和订单号关键字获取所有订单的数量
    int getFatherOrderCountByNameKeyWord(Map<String, Object> map);

    //根据ID删除订单
    int delFatherOrderByID(long fatherOrderid);
}
